class Person(object):

    def __init__(self, name, age):
        self._name = name    # 设置为私有的
        self._age = age

    @property
    def name(self):
        return self._name

    @property    # 设置get方法
    def age(self):
        
        return self._age

    @age.setter    # 设置set方法
    def age(self, age):
        self._age = age

    @name.setter
    def name(self, name):
        self._name = name

    def play(self):
        if self.age <= 16:
            print("%s 正在玩飞行棋" % self.name)
        else:
            print("%s 正在玩王者永耀" % self.name)


def main():
    p = Person("小明", 12)
    p.play()
    p.age = 22
    p.play()
    p.name = "希洪"
    p.play()


if __name__ == '__main__':
    main()
